﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using System.IO;

namespace RssReader.ViewModel
{
    public partial class Detail : PhoneApplicationPage
    {
        public Detail()
        {
            InitializeComponent();
        }
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);
            string detail = "";
            string main = "";
            if (NavigationContext.QueryString.TryGetValue("detail", out detail))
            {
                main = Htmlrmover.StripTagsCharArray(detail);
                //main = Htmlrmover.StripSpaceCharArray(main);
                //_content.Text = main;
                StreamReader stream = new StreamReader(@"Css.txt");
                string myString = stream.ReadToEnd();
                string html = @"<html><head><meta charset=" + "utf-8" + "/>" + myString + ">" + detail + "</body></html>";
                browser.NavigateToString(html);
            }
        }
    }
}